<?php require RCMS_Object_QuickConfig_QuickConfig::PATH_HEADER; ?>
<?php echo $this->headLink()->appendStylesheet($this->websiteUrl . 'system/css/seotoaster.css'); ?>
<?php if (!$this->isPost) : ?>
    <?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/jquery/jquery.js'); ?>
    <?php $this->headScript()->appendFile($this->websiteUrl .'system/js/jquery/plugins/dragndrop/jquicustommin.js'); ?>
    <?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/featuredarea/featuredarea.js'); ?>
    <?php echo $this->headScript(); ?>
    <script type="text/javascript">
    $(document).ready(function(){
        $(".fa-order-list").sortable();
        $('.formsubmit').ajaxSuccess(function(){
           parent.tb_remove(); top.location.reload();
        });
    });
    </script>
<?php endif; ?>
<div id="seotoaster" class="featuredareaorder"<?php echo $this->isPost ? ' style="border:0;height:460px"':''; ?>>
<?php if (!$this->isPost): ?>
    <div class="admineditwhat">{%Featured Areas%}</div>
    <div class="close_window" onclick="parent.tb_remove();"></div>
<?php endif; ?>
<h3 align="center"<?php echo $this->isPost ? ' style="padding:5px 0px;"':''; ?>>{%Order in:%} <span title="<?php echo $this->faName; ?>"><?php echo substr($this->faName,0,40); ?></span></h3>
    <?php if (count($this->data) > 0): ?>
    <ul class="fa-order-list" id="fa-order-id-<?php echo $this->faId; ?>">
        <?php foreach ($this->data as $item): ?>
            <li id="fa-order-pageid-<?php echo $item['page_id']; ?>">
                <img alt="drag-icon" width="16" height="16" src="<?php echo $this->websiteUrl; ?>system/images/drag_icon.gif" />
            <span><?php echo $item['nav_name']; ?></span></li>
        <?php endforeach; ?>
    </ul>
    <button class="formsubmit" onclick="<?php echo $this->isPost ? "$('#fa-order').hide();" :  ''; ?> saveOrderFeaturedArea();" style="position:absolute;right:20px;bottom:20px;">{%Save%}</button>
    <button class="formsubmit" onclick="<?php echo $this->isPost ? "$('#fa-order').hide();" : "parent.tb_remove();"?>" style="left:150px;position:absolute;bottom:20px;">{%Cancel%}</button>
    <?php else: ?>
    <button class="formsubmit" onclick="<?php echo $this->isPost ? "$('#fa-order').hide();" : "parent.tb_remove();"?>" style="position:absolute;right:20px;bottom:20px;">{%Cancel%}</button>
    <?php  endif; ?>
    <input type="hidden" name="website_url" id="website_url" value="<?php echo $this->websiteUrl; ?>" />
</div>